x11: Fix window manager change detection
authorRui Matos <tiagomatos@gmail.com>
Sat, 5 Nov 2011 05:36:52 +0000 (01:36 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 5 Nov 2011 05:37:37 +0000 (01:37 -0400)
Since the wmspec_check_window doesn't have a corresponding GdkWindow we can't
rely on the get_event_window() return value to get the XID from. Just use the
XID from the XEvent directly.

https://bugzilla.gnome.org/show_bug.cgi?id=662953

gdk/x11/gdkdisplay-x11.c

index 95b22f655a6f28d3d47e9df5c95df1a6b8e8c054..d71e8caefd9b27560828c944c6295e1a22aa1615 100644 (file)
@@ -385,7 +385,6 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
   GdkToplevelX11 *toplevel = NULL;
   GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
   gboolean return_val;
-  Window xwindow = None;
 
   /* Find the GdkWindow that this event relates to.
    * Basically this means substructure events
@@ -405,7 +404,6 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
       x11_screen = GDK_X11_SCREEN (screen);
       toplevel = _gdk_x11_window_get_toplevel (window);
       window_impl = GDK_WINDOW_IMPL_X11 (window->impl);
-      xwindow = GDK_WINDOW_XID (window);
 
       g_object_ref (window);
     }
@@ -432,7 +430,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
           screen = gdk_display_get_screen (display, i);
           x11_screen = GDK_X11_SCREEN (screen);
 
-          if (x11_screen->wmspec_check_window == xwindow)
+          if (x11_screen->wmspec_check_window == xevent->xdestroywindow.window)
             {
               x11_screen->wmspec_check_window = None;
               x11_screen->last_wmspec_check_time = 0;